package com.foreknow;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入消费金额：");
        double money = input.nextDouble();
        System.out.println("是否参加优惠换购活动：");
        System.out.println("1.满50元，加2元换购商品A");
        System.out.println("2.满100元，加3元换购商品B");
        System.out.println("3.满100元，加10元换购商品C");
        System.out.println("4.满200元，加10元换购商品D");
        System.out.println("5.满200元，加20元换购商品E");
        System.out.println("请选择：");
        String dis = input.next();
        if ("是".equals(dis)){
            System.out.println("请选择：");
            int num = input.nextInt();
            switch (num){
                case 1:
                    if (money > 50){
                        System.out.println("本次消费总金额："+(money+2));
                        System.out.println("成功换购商品A");
                    }else {
                        System.out.println("消费金额不足");
                    }
                    break;
                case 2:
                    if (money > 100){
                        System.out.println("本次消费总金额："+(money+3));
                        System.out.println("成功换购商品B");
                    }else {
                        System.out.println("消费金额不足");
                    }
                    break;
                case 3:
                    if (money > 100){
                        System.out.println("本次消费总金额："+(money+10));
                        System.out.println("成功换购商品C");
                    }else {
                        System.out.println("消费金额不足");
                    }
                    break;
                case 4:
                    if (money > 200){
                        System.out.println("本次消费总金额："+(money+10));
                        System.out.println("成功换购商品D");
                    }else {
                        System.out.println("消费金额不足");
                    }
                    break;
                case 5:
                    if (money > 200){
                        System.out.println("本次消费总金额："+(money+20));
                        System.out.println("成功换购商品E");
                    }else {
                        System.out.println("消费金额不足");
                    }
                    break;
            }
        }
        else if ("否".equals(dis)){
            System.out.println("本次消费总金额："+money);
        }
    }
}
